package com.cj.mobile.iabp.mvp.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @ProjectName: NewRecyclingAndroid
 * @Package: com.zqw.mobile.recycling.model
 * @ClassName: BatchDeliveryInfo
 * @Description: 批量交货信息
 * @Author: WLY
 * @CreateDate: 2024/1/5 16:23
 */
public class BatchDeliveryInfo implements Parcelable {
    public BatchDeliveryInfo() {
    }

    public BatchDeliveryInfo(String storeName, double totalWeight, double totalAmount, List<BatchDeliveryMode> modelList) {
        this.storeName = storeName;
        this.totalWeight = totalWeight;
        this.totalAmount = totalAmount;
        this.modelList = modelList;
    }

    public BatchDeliveryInfo(String userId, String storeName, double totalWeight, double availableWeight, double totalSignWeight, double totalAmount, String orderNo, String recycleId, String orderSubNo, List<BatchDeliveryMode> modelList) {
        this.userId = userId;
        this.storeName = storeName;
        this.totalWeight = totalWeight;
        this.availableWeight = availableWeight;
        this.totalSignWeight = totalSignWeight;
        this.totalAmount = totalAmount;
        this.modelList = modelList;
        this.orderNo = orderNo;
        this.recycleId = recycleId;
        this.orderSubNo = orderSubNo;
    }

    // 门店id
    private String userId;
    // 门店名称
    private String storeName;
    // 总计量
    private double totalWeight;
    // 总金额
    private double totalAmount;
    // 电池型号
    private List<BatchDeliveryMode> modelList;
    // 回收订单号
    private String orderNo;
    // 回收员id
    private String recycleId;
    //  回收订单的 子订单号
    private String orderSubNo;

    // 是否是新增项
    private boolean isAdd;
    // 是否已选中
    private boolean isCheckBox;
    // 可交货重量
    private double availableWeight;
    // 合计量
    private double totalSignWeight;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public double getTotalWeight() {
        return totalWeight;
    }

    public void setTotalWeight(double totalWeight) {
        this.totalWeight = totalWeight;
    }

    public double getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(double totalAmount) {
        this.totalAmount = totalAmount;
    }

    public List<BatchDeliveryMode> getModelList() {
        return modelList;
    }

    public void setModelList(List<BatchDeliveryMode> modelList) {
        this.modelList = modelList;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getRecycleId() {
        return recycleId;
    }

    public void setRecycleId(String recycleId) {
        this.recycleId = recycleId;
    }

    public String getOrderSubNo() {
        return orderSubNo;
    }

    public void setOrderSubNo(String orderSubNo) {
        this.orderSubNo = orderSubNo;
    }

    public boolean isAdd() {
        return isAdd;
    }

    public void setAdd(boolean add) {
        isAdd = add;
    }

    public boolean isCheckBox() {
        return isCheckBox;
    }

    public void setCheckBox(boolean checkBox) {
        isCheckBox = checkBox;
    }

    public double getAvailableWeight() {
        return availableWeight;
    }

    public void setAvailableWeight(double availableWeight) {
        this.availableWeight = availableWeight;
    }

    public double getTotalSignWeight() {
        return totalSignWeight;
    }

    public void setTotalSignWeight(double totalSignWeight) {
        this.totalSignWeight = totalSignWeight;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.userId);
        dest.writeString(this.storeName);
        dest.writeDouble(this.totalWeight);
        dest.writeDouble(this.totalAmount);
        dest.writeTypedList(this.modelList);
        dest.writeString(this.orderNo);
        dest.writeString(this.recycleId);
        dest.writeString(this.orderSubNo);
        dest.writeByte(this.isAdd ? (byte) 1 : (byte) 0);
        dest.writeByte(this.isCheckBox ? (byte) 1 : (byte) 0);
        dest.writeDouble(this.availableWeight);
        dest.writeDouble(this.totalSignWeight);
    }

    public void readFromParcel(Parcel source) {
        this.userId = source.readString();
        this.storeName = source.readString();
        this.totalWeight = source.readDouble();
        this.totalAmount = source.readDouble();
        this.modelList = source.createTypedArrayList(BatchDeliveryMode.CREATOR);
        this.orderNo = source.readString();
        this.recycleId = source.readString();
        this.orderSubNo = source.readString();
        this.isAdd = source.readByte() != 0;
        this.isCheckBox = source.readByte() != 0;
        this.availableWeight = source.readDouble();
        this.totalSignWeight = source.readDouble();
    }

    protected BatchDeliveryInfo(Parcel in) {
        this.userId = in.readString();
        this.storeName = in.readString();
        this.totalWeight = in.readDouble();
        this.totalAmount = in.readDouble();
        this.modelList = in.createTypedArrayList(BatchDeliveryMode.CREATOR);
        this.orderNo = in.readString();
        this.recycleId = in.readString();
        this.orderSubNo = in.readString();
        this.isAdd = in.readByte() != 0;
        this.isCheckBox = in.readByte() != 0;
        this.availableWeight = in.readDouble();
        this.totalSignWeight = in.readDouble();
    }

    public static final Creator<BatchDeliveryInfo> CREATOR = new Creator<BatchDeliveryInfo>() {
        @Override
        public BatchDeliveryInfo createFromParcel(Parcel source) {
            return new BatchDeliveryInfo(source);
        }

        @Override
        public BatchDeliveryInfo[] newArray(int size) {
            return new BatchDeliveryInfo[size];
        }
    };
}
